from src.core.models.dto import ProductDTO, ProductWithParamsDTO
from src.database.models import Calendar


def convert_db_model_to_product_dto(product: Calendar) -> ProductDTO:
    return ProductDTO(
        id=product.id,
        title=product.title,
        image_path=product.image_path,
        description=product.description,
        category_id=product.category_id,
        price=product.price,
        weight=product.weight,
        strain_name=product.strain_name,
        strain_type=product.strain_type,
        thc=product.thc,
        origin=product.origin,
        pgr=product.pgr,
        vhq=product.vhq,
        cbd=product.cbd,
    )


def convert_db_model_to_product_with_params_dto(product: Calendar) -> ProductDTO:
    return ProductWithParamsDTO(
        id=product.id,
        title=product.title,
        image_path=product.image_path,
        description=product.description,
        category_id=product.category_id,
        price=product.price,
        weight=product.weight,
        feelings=product.feelings,
        genetics=product.genetics,
        strain_name=product.strain_name,
        strain_type=product.strain_type,
        thc=product.thc,
        origin=product.origin,
        pgr=product.pgr,
        vhq=product.vhq,
        cbd=product.cbd,
    )
